home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!usenet
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: new with multidimensional arrays
- Date: Fri, 12 Apr 1996 15:24:00 GMT
- Organization: InfoRamp Inc., Toronto, Ontario (416) 363-9100
- Message-ID: <4kli21$blc@sam.inforamp.net>
- References: <3169B9C3.2A10@MIT.EDU>
- NNTP-Posting-Host: ts10-10.tor.istar.ca
- X-Newsreader: Forte Free Agent 1.0.82
-
- Darrel K Robertson <dkr1@MIT.EDU> wrote:
-
- >Hi, I wonder if anyone can help me. I want to use "new" to create a
- >multidimensional array, but don't know how. So far I have:
- >complex *grid;
- >scanf("%d %d", &nc, &nr);
- >grid = new complex[nc][nr];
-
- complex **grid;
- scanf("%d %d", &nc, &nr);
- grid = new complex *[nc];
- for (int i=0;i<nr;i++)
- grid[i] = new complex[nr];
-
- Or something like that.
-
-
-
- Agrivar
-
- aka Randy Charles Morin,
- MiddleWorld SoftWare,
- Satisfying Your Bit and Bytes,
- Canada 1-800-363-3780
- Other 1-905-279-2087
- eMail rmorin@inforamp.net
-
-